<script setup lang="ts">
import { ConfigProvider } from 'tdesign-vue-next';
import { useLocale } from './hooks/useLocale';
import { merge } from 'lodash-es'

const { locale, getComponentsLocale } = useLocale();

const globalConfig = merge({}, getComponentsLocale.value, {
  // 覆盖配置项
  dialog: {
    closeOnEscKeydown: false,
    closeOnOverlayClick: false,
  }
});

</script>

<template>
  <config-provider :global-config="globalConfig">
    <router-view :key="locale" />
  </config-provider>
</template>

<style scoped></style>
